#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QDockWidget* dockWidget = new QDockWidget();
    dockWidget->setWindowTitle("this is a dockWidget");
    this->addDockWidget(Qt::TopDockWidgetArea,dockWidget);
    QWidget* container = new QWidget();
    dockWidget->setWidget(container);
    QLabel* label = new QLabel("hello");
    QPushButton* button = new QPushButton("hello");
    QVBoxLayout* layout = new QVBoxLayout();
    layout->addWidget(label);
    layout->addWidget(button);
    container->setLayout(layout);

    dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::TopDockWidgetArea);

}

MainWindow::~MainWindow()
{
    delete ui;
}

